import { imageIsExist } from './index'

export default Vue => {
    Vue.directive('real-img', async function (el, binding) {
        let imgURL = binding.value
        if (imgURL) {
            let exist = await imageIsExist(imgURL)
            if (exist) {
                el.setAttribute('src', imgURL)
            } 
        }
    })
}